pkgname=qt5-qtwayland
pkgver=5.9.1
pkgrel=1
arch="all"
url='http://qt-project.org/'
license="GPL3 LGPL3 FDL custom"
pkgdesc='Provides APIs for Wayland'
depends="qt5-qtdeclarative libxcomposite wayland"
makedepends="qt5-qtbase-dev libxkbcommon-dev"
source="http://download.qt.io/official_releases/qt/${pkgver%.*}/${pkgver}/submodules/${pkgname/qt5-/}-opensource-src-$pkgver.tar.xz"

prepare() {
	mkdir -p $srcdir/build
}

build() {
	cd $srcdir/build

	qmake-qt5 $srcdir/${pkgname/qt5-/}-opensource-src-$pkgver
	make
}

package() {
	cd $srcdir/build

	make INSTALL_ROOT="$pkgdir" install

	# Drop QMAKE_PRL_BUILD_DIR because reference the build dir
	find "$pkgdir/usr/lib" -type f -name '*.prl' \
		-exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;

	install -d "$pkgdir"/usr/share/licenses
	ln -s /usr/share/licenses/qt5-base "$pkgdir"/usr/share/licenses/${pkgname}
}
sha512sums="619025f6db1234e2e85e8790ca152765696b3019414e4de1a7630ef3cb5a11fa3d0f3955f1e2e9e82f05a90a6da3a0a355c3c4de4dc0006cb91f122428031df3  qtwayland-opensource-src-5.9.1.tar.xz"
